class OrderTripEnd {
  String driverId;
  String startTime;
  String endTime;
  String distance;
  Cost cost;

  OrderTripEnd(
      {this.driverId, this.startTime, this.endTime, this.distance, this.cost});

  OrderTripEnd.fromJson(Map<String, dynamic> json) {
    driverId = json['driver_id'];
    startTime = json['start_time'];
    endTime = json['end_time'];
    distance = json['distance'];
    cost = json['cost'] != null ? new Cost.fromJson(json['cost']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['driver_id'] = this.driverId;
    data['start_time'] = this.startTime;
    data['end_time'] = this.endTime;
    data['distance'] = this.distance;
    if (this.cost != null) {
      data['cost'] = this.cost.toJson();
    }
    return data;
  }
}

class Cost {
  String sumCost;
  String startCost;
  num timeCost;
  String distanceCost;

  Cost({this.sumCost, this.startCost, this.timeCost, this.distanceCost});

  Cost.fromJson(Map<String, dynamic> json) {
    sumCost = json['sum_cost'];
    startCost = json['start_cost'];
    timeCost = json['time_cost'];
    distanceCost = json['distance_cost'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['sum_cost'] = this.sumCost;
    data['start_cost'] = this.startCost;
    data['time_cost'] = this.timeCost;
    data['distance_cost'] = this.distanceCost;
    return data;
  }
}
